import { Component, OnInit } from '@angular/core';
import { MatDialogRef} from '@angular/material/dialog';
import { GitConfig } from '@api/git';
import { GitManagerService } from '@common/services/git/gitmanager';

@Component({
  selector: 'kd-git-dialog',
  templateUrl: './git-dialog.component.html',
  styleUrls: ['./git-dialog.component.scss']
})
export class GitDialogComponent implements OnInit {

  newconfig:GitConfig={
    id: 0,
    name: "",
    url: "",
    path: "",
    authid: 0,
    status :"",
  }
  AddNew(){
    this.gits.createGitConfig(this.newconfig).subscribe(
      data => console.log(data)
    )
  }
  constructor(
    public dialogRef: MatDialogRef<GitDialogComponent>,
    private readonly gits :GitManagerService) { }
  ngOnInit(): void {

  }
  onNoClick(){
    this.dialogRef.close();
  }
}

